home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Rexx / DefineAnimGif.pprx < prev    next >
Text File  |  2000-05-08  |  4KB  |  121 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1997 Cloanto Italia srl */
  2.  
  3. /* $VER: DefineAnimGif.pprx 1.0 */
  4.  
  5. /** ENG
  6.  This tool works exactly like the Define Anim-Brush tool which is part
  7.  of the Personal Paint tool bar (three clicks on Define Brush), but it
  8.  additionally stores frame timing information in the anim-brush in a
  9.  format compatible with GIF animations, which can then be saved by the
  10.  SaveAnimGif script.
  11. */
  12.  
  13. /** DEU
  14.  Dieser nützliche Helfer arbeitet genau wie die Funktion zum Erstellen eines
  15.  Animationspinsels in der Werkzeugleiste von Personal Paint (dreifacher
  16.  Mausklick auf das Symbol "Pinsel definieren"). Im Gegensatz zu diesem werden
  17.  jedoch zusätzlich Informationen zum Einzelbildtiming in einem zu
  18.  GIF-Animationen kompatiblen Format mitgespeichert, welche anschließend sich
  19.  mit dem Skript SaveAnimGif sichern lassen.
  20. */
  21.  
  22. /** ITA
  23.  Questo strumento funziona esattamente come quello Definire Anim-Brush,
  24.  che fa parte della barra degli strumenti di Personal Paint (tre click
  25.  su Definire pennello), ma in più immagazzina informazioni sulla
  26.  temporizzazione dei fotogrammi all'interno dell'anim-brush, in un formato
  27.  compatibile con le animazioni GIF, che si può poi salvare tramite lo script
  28.  SaveAnimGif.
  29. */
  30.  
  31. IF ARG(1, EXISTS) THEN
  32.     PARSE ARG PPPORT button x0 y0 rwidth rheight .
  33. ELSE
  34.     EXIT 0  /* macro execution only */
  35.  
  36. ADDRESS VALUE PPPORT
  37. OPTIONS RESULTS
  38. OPTIONS FAILAT 10000
  39.  
  40. Get 'LANG'
  41. IF RESULT = 1 THEN DO        /* Deutsch */
  42.     txt_title_req     = "GIF Anim-Pinsel definieren"
  43.     txt_gad_getf      = "_Einzelbilder:"
  44.     txt_gad_dir       = "_Richtung:"
  45.     txt_gad_dir0      = "Vorwärts"
  46.     txt_gad_dir1      = "Rückwärts"
  47.     txt_err_noanim    = "Umgebung enthält_keine Animation"
  48.     txt_err_oldclient = "Für dieses Skript_ist eine neuere Version_von Personal Paint erforderlich"
  49. END
  50. ELSE IF RESULT = 2 THEN DO    /* Italiano */
  51.     txt_title_req     = "Creare Anim-Brush GIF"
  52.     txt_gad_getf      = "_Fotogrammi:"
  53.     txt_gad_dir       = "Di_rezione:"
  54.     txt_gad_dir0      = "Avanti"
  55.     txt_gad_dir1      = "Indietro"
  56.     txt_err_noanim    = "L'ambiente attuale_non contiene un'animazione"
  57.     txt_err_oldclient = "Questa procedura richiede_una versione più recente_di Personal Paint"
  58. END
  59. ELSE DO                /* English */
  60.     txt_title_req     = "Define GIF Anim-Brush"
  61.     txt_gad_getf      = "Get _frames:"
  62.     txt_gad_dir       = "_Direction:"
  63.     txt_gad_dir0      = "Forward"
  64.     txt_gad_dir1      = "Backward"
  65.     txt_err_noanim    = "The current environment_does not contain an animation"
  66.     txt_err_oldclient = "This script requires a newer_version of Personal Paint"
  67. END
  68.  
  69. Version 'REXX'
  70. IF RESULT < 7 THEN DO
  71.     RequestNotify 'PROMPT "'txt_err_oldclient'"'
  72.     EXIT 10
  73. END
  74.  
  75. LockGUI
  76. GetFrames
  77. frnum = RESULT
  78. IF frnum > 0 THEN DO
  79.     Request '"'txt_title_req'" ' ||,
  80.              '"INTSTR = ""'txt_gad_getf'"", 1, 'frnum', 'frnum' ' ||,
  81.              ' CYCLE = ""'txt_gad_dir'"", 2, 0, ""'txt_gad_dir0'"", ""'txt_gad_dir1'"" "'
  82.     IF RC = 0 THEN DO
  83.         get_fnum = RESULT.1
  84.         IF RESULT.2 = 1 THEN DO
  85.             get_dir = 'BACK'
  86.             get_step = -1
  87.         END
  88.         ELSE DO
  89.             get_dir = ''
  90.             get_step = 1
  91.         END
  92.  
  93.         Version 'PROGRAM'
  94.         PARSE VAR RESULT pver'.'prev
  95.         IF pver < 7 | (pver = 7 & prev < 1) THEN
  96.             button = button + 1
  97.  
  98.         IF button = 3 THEN
  99.             get_mode = 'ERASE'
  100.         ELSE
  101.             get_mode = ''
  102.         DefineBrush x0 y0 x0+rwidth-1 y0+rheight-1 'FRAMES' get_fnum get_dir get_mode
  103.  
  104.         GetFramePosition
  105.         pos = RESULT
  106.         delays = ''
  107.         DO frm = pos FOR get_fnum BY get_step
  108.             IF frm = 0 THEN
  109.                 frm = frnum
  110.             ELSE IF frm > frnum THEN
  111.                 frm = 1
  112.             GetFrameDelay 'FRAME' frm
  113.             delays = delays TRUNC((RESULT * 100/60) + 0.5)
  114.         END
  115.         SetBrushInfo 'ANNOTATION "LOOP -1 DELAY' delays'"'
  116.     END
  117. END
  118. ELSE RequestNotify 'PROMPT "'txt_err_noanim'"'
  119.  
  120. UnlockGUI
  121.